namespace CSharpPro._1021;

public class UserTestImpl : UserTest
{
    public override void M1()
    {
        Console.WriteLine("执行M1方法");
    }

    public override int M2(string input)
    {
        Console.WriteLine($"执行M2方法：输入参数为'{input}'");
        return input?.Length ?? 0; 
    }

    public override void M3(double value, bool flag)
    {
        Console.WriteLine($"执行M3方法：数值参数={value}，布尔参数={flag}");
        if (flag)
        {
            Console.WriteLine($"处理结果：{value * 2}");
        }
        else
        {
            Console.WriteLine($"处理结果：{value / 2}");
        }
    }
}